package com.example;

import javax.microedition.khronos.opengles.GL10;

import com.step.Step;
import com.step.mesh.parser.IParser;
import com.step.mesh.parser.MD2Parser;
import com.step.mesh.parser.Parser;
import com.step.sprite.Md2Sprite;

public class Md2ParserExample extends BaseExample{
	Md2Sprite sprite3d;
	@Override
	public void create() {		
		IParser parser = Parser.createParser(Step.files.internal("model/ogro.md2"), true);
		parser.parse();
		sprite3d = ((MD2Parser)parser).getMd2Sprite();
		sprite3d.setPosition(0, 0, -3);
		sprite3d.setScale(0.03f, 0.03f, 0.03f);
		sprite3d.setRotation(0, -90, 0);
		sprite3d.getAnimation().play();
	}

	@Override
	public void update() {
		GL10 gl = Step.gl;
		gl.glLoadIdentity();
		gl.glClearColor(1, 1, 1, 1);
		sprite3d.draw(gl);
	}
}
